/**
 * 创建于：6/12/16
 * 创建人：qizhang
 */
@import "../../styles/variables";
@import "../../styles/mixins";

.sem-select {
  position: relative;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  display: inline-block;
  min-width: 6.875rem;
  border: solid 1px $color-primary;
  height: $form-control-height;
  line-height: (20px/14px);
  padding: ($form-control-height - 1.375rem) / 2 0;
  outline: none;
  border-radius: $border-radius;
  vertical-align: middle;
  background-color: #fff;
  font-size: 12px;
  cursor: pointer;
  &.little{
    min-width: 50px;
  }
  &.thin {
    height: $form-control-height-thin;
    padding: ($form-control-height-thin - 1.375rem) / 2 0;
  }

  &.editable{
    border: none
  }

  .select-picker {
    padding-left: 10px;
    padding-right: 25px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    .select-label {
      margin-right: 20px;
      color: #a9a9a9;
    }
  }
  .select-input{
    position: relative;
    top: -7px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 150px;
    border: solid 1px $color-primary;
    height: 30px;
    padding-left: 10px;
    padding-right: 25px;
    border-radius: $border-radius;
    background-color: #fff;
    font-size: 12px;
    cursor: pointer;
  }

  .select-drop-icon {
    display: inline-block;
    background-image: url('./drop_icon.png');
    height: 10px;
    width: 10px;
    position: absolute;
    right: 10px;
    top: 50%;
    margin-top: -5px;
    -webkit-transition: transform .2s ease;
    transition: transform .2s ease;
  }

  .select-drop-down {
    background-color: #fff;
    position: absolute;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-border-radius: 2px;
    border-radius: 2px;
    border: solid 1px $color-primary;
    top: 100%;
    width: 100%;
    margin-top: 6px;
    z-index: 2;
    //-webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.26);
    //box-shadow: 0 1px 8px rgba(0, 0, 0, 0.26);

    .arrow {
      $size: 4px;
      position: absolute;
      top: -($size + 1px);
      border-bottom: solid $size $color-primary;
      border-left: solid $size transparent;
      border-right: solid $size transparent;

      &:before {
        content: '';
        left: -$size;
        position: absolute;
        top: 1px;
        border-bottom: solid $size #fff;
        border-left: solid $size transparent;
        border-right: solid $size transparent;
      }
      z-index: 2;
      left: 4px;
    }

    .select-list {
      max-height: 200px;
      overflow: hidden;
      overflow-y: auto;
      position: relative;
      margin: 2px 0;
      .select-list-item {
        padding: 6px 8px;
        cursor: pointer;
        &.active {
          color: #fff;
        }

        &:hover {
          background-color: #f1f1f1;
        }

        &.active {
          background-color: $color-primary;
        }
      }

      .empty {
        padding: 6px 10px;
        color: #ccc;
      }
    }
  }

  &.open {
    .select-drop-icon {
      -webkit-transform: rotate(180deg);
      -ms-transform: translateY(180deg);
      transform: translateY(180deg);
    }
    .select-drop-down {
      z-index: 99;
    }
  }
}